#include "Renderer.h"
#include "TriMesh.h"

TriMesh::TriMesh( unsigned int num_vertices, Vector3* vertex, Vector3* normal, Color* color,
				 Vector2* texture, unsigned int num_triangles, unsigned int* connect )
				 :Geometry( num_vertices, vertex, normal, color, texture )

{
	m_num_triangles = num_triangles;
	m_connect = connect;
}

TriMesh::TriMesh()
{
	m_num_triangles = 0;
	m_connect = 0;
}

TriMesh::~TriMesh()
{
	delete[] m_connect;
}

void TriMesh::reconstruct( unsigned int num_vertices, unsigned int num_triangles )
{
	Geometery::reconstruct( num_vertices );
	m_num_triangles = num_triangles;
	delete[] m_connect;
	if ( m_num_triangles > 0 )
		m_connect = new unsigned int[3*m_num_triangles];
}
